package cn.edu.zucc.GUIUtil;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;

public class GUIUtil {
	static public void centerWindow(JFrame frame){
		Toolkit tk = Toolkit.getDefaultToolkit();
		Dimension d = tk.getScreenSize();
		int w = ((int)d.getWidth() - frame.getWidth()) / 2;
		int h = ((int)d.getHeight() - frame.getHeight()) / 2;
		frame.setLocation(w, h);
	}
}
